/*
 * Copyright (c) 2008-2012
 * LANIT
 * All rights reserved.
 *
 * This product and related documentation are protected by copyright and
 * distributed under licenses restricting its use, copying, distribution, and
 * decompilation. No part of this product or related documentation may be
 * reproduced in any form by any means without prior written authorization of
 * LANIT and its licensors, if any.
 *
 * $Id$
 */

import oracle.jdbc.pool.OracleDataSource;

import java.sql.SQLException;

/**
 * todo Document type DataSourceFactory
 */
public class DataSourceFactory {

    private OracleDataSource bdSource;

    public DataSourceFactory(String dataBaseDriver, String url, String userName, String passwd) throws SQLException {
        bdSource = new OracleDataSource();
        bdSource.setDriverType(dataBaseDriver);
        bdSource.setURL(url);
        bdSource.setUser(userName);
        bdSource.setPassword(passwd);
    }

    public DataSourceFactory() throws SQLException {
        bdSource = new OracleDataSource();
        bdSource.setDriverType("oracle.jdbc.driver.OracleDriver");
        bdSource.setURL("jdbc:oracle:thin:@192.168.75.161:1521:orclpega");
        bdSource.setUser("njc");
        bdSource.setPassword("111111");
    }

    public OracleDataSource getDataSource() {
        return bdSource;
    }
}
